package com.hhb.web.controller;

import com.hhb.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
public class TestController {

    @Autowired
    private TestService testService;

    //@ResponseBody
    @RequestMapping("/test")
    public String test(HttpServletResponse response) throws IOException {
        String sayHello = testService.sayHello("黄陈浮生");
        response.getWriter().write(sayHello);
        return "test";
    }
}
